<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %><%--
  Created by IntelliJ IDEA.
  User: 任宝顺
  Date: 2022/3/5
  Time: 16:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>更新饮品信息</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" type="text/css"
        href="${pageContext.request.contextPath}/css/style.css" />
</head>

<body>
<div id="wrap">
  <div id="top_content">
    <div id="header">
      <div id="rightheader">
        <p>
          <% Date date = new Date();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:dd");
            String now = sdf.format(date);
          %>
          <%=now%>
          <br />
        </p>
      </div>
      <div id="topheader">
        <h1 id="title">
          <a href="#">Main</a>
        </h1>
      </div>
      <div id="navigation">
      </div>
    </div>
    <div id="content">
      <p id="whereami">
      </p>
      <h1>
        修改饮品信息
      </h1>
      <form action="${pageContext.request.contextPath}/grang/updateTea.do" method="post">
        <table cellpadding="0" cellspacing="0" border="0" class="form_table">
          <tr>
            <td valign="middle" align="right">
              饮品名称:
            </td>
            <td valign="middle" align="left">
              <input type="hidden" class="inputgri"  name="teaId" value="${tea.teaId}" />
              <input type="text" class="inputgri" name="teaName" value="${tea.teaName}"/>
              `</td>

          </tr>
          <tr>
            <td valign="middle" align="right">
              饮品价格:
            </td>
            <td valign="middle" align="left">
              <input type="text" class="inputgri" name="teaPrice" value="${tea.teaPrice}"/>
            </td>
          </tr>
          <tr>
            <td valign="middle" align="right">
              类别:
            </td>
            <td valign="middle" align="left">
              <select name="cateId">
              <c:forEach items="${categories}" var="category">
                <option value="${category.categoryId}"
                        <c:if test="${tea.cateId == category.categoryId}">
                            selected="selected"
                       </c:if>
              >${category.categoryName}</option>

              </c:forEach>
              </select>

            </td>
          </tr>
        </table>
        <p>
          <input type="submit" class="button" value="修改" />
        </p>
      </form>
    </div>
  </div>
  <div id="footer">
    <div id="footer_bg">
      ABC@126.com
    </div>
  </div>
</div>
</body>
</html>
